
<% String title="DAS Example Commands";
   String header = title;
%>



<%@ include file="sangerheader.jsp" %>


<div id="normalcontent">
<div class="contentarea">
<h1>DAS Example Commands</h1>
For the DAS workshop this year and for general use we decided it would be a good idea to have a glossary/command summary showing examples of working commands that could be used on DAS servers and the registry. This is meant as an easy/quick reference summary only but for further details on the requests and responses that can be made please refer to <a title="http://www.biodas.org/documents/spec-1.6.html" href="http://www.biodas.org/documents/spec-1.6.html">http://www.biodas.org/documents/spec-1.6.html</a>. Further examples can be found from http://www.dasregistry.org/listSources.jsp you can filter on commands by choosing from the dropdown capability menu at the top, lights next to each datasource represent the validity of each command or capability as determined by the Das Registry. Click on a light to see the request and response for that server in your browser.

<div class="divider1"></div>
<div id="primarycontainer">
<div id="primarycontent">

<h1>The DAS Registry commands:</h1>

The DAS registry responds to a few commands:sources, coordinatesystem, knownCapabilities, lastModified, validate<br/>
Note: that das/ can usually be replaced by das1/ and you will get the same results. Also recently it is now possible to use ; as a parameter seperator as well as the &amp; I'm not sure what the behaviour is if you mix these so i'd recommend using one seperator or the other in commands sent to the registry

<h2>Sources Commands</h2> (get DAS sources that have been registered with the registry):
<ul><li><a title="http://www.dasregistry.org/das/DS_111" href="http://www.dasregistry.org/das/DS_111">http://www.dasregistry.org/das/DS_111</a> Get the sources document for a single DAS source with the registry id DS-111 held in the registry 
</li>
<li>
<a title="http://www.dasregistry.org/das/sources?keywords=zebrafish" href="http://www.dasregistry.org/das/sources?keywords=zebrafish">http://www.dasregistry.org/das/sources?keywords=zebrafish</a> keywords parameter to filter the sources to ones that match the keyword, can use wildcards and booleans.
</li>
<li>
<a title="http://www.dasregistry.org/das/sources?typeskeywords=gene&amp;rows=1-10" href="http://www.dasregistry.org/das/sources?typeskeywords=gene&amp;rows=1-10">http://www.dasregistry.org/das/sources?typeskeywords=gene</a> typeskeywords returns sources that have a type from their types command that matches the typeskeyword
</li><li>
<a title="http://www.dasregistry.org/das/sources?rows=1-2" href="http://www.dasregistry.org/das/sources?rows=1-2">http://www.dasregistry.org/das/sources?rows=1-2</a> rows capability for the sources cmd  Note: start, end attributes are added to the response if rows have been specified.
</li>
<li>
<a title="http://www.dasregistry.org/das1.6/sources" href="http://www.dasregistry.org/das1.6/sources">http://www.dasregistry.org/das1.6/sources</a> as apposed to 1.5 sources <a title="http://www.dasregistry.org/das1.5/sources" href="http://www.dasregistry.org/das1.5/sources">http://www.dasregistry.org/das1.5/sources</a> request sources document for 1.6E compliant sources only
</li>
<li>
<a title="http://www.dasregistry.org/das/sources?serverUrl=http://www.ensembl.org/das&amp;rows=1-10" href="http://www.dasregistry.org/das/sources?serverUrl=http://www.ensembl.org/das&amp;rows=1-10"> http://www.dasregistry.org/das/sources?serverUrl=http://www.ensembl.org/das&amp;rows=1-10</a> serverUrl filter option to filter the sources returned to those that originate from a specific server in this case ensembl and this returns the first 10 rows.
</li><li>
<a title="http://www.dasregistry/das1/sources?organism=9606&amp;authority=NCBI&amp;type=chromosome&amp;version=36" href="http://www.dasregistry/das1/sources?organism=9606&amp;authority=NCBI&amp;type=chromosome&amp;version=36">http://www.dasregistry/das1/sources?organism=9606&amp;authority=NCBI&amp;type=chromosome&amp;version=36</a> filter on coordinate system using organism and or authority, version etc
</li>
<li>
filter on capability stated by the registrant, the response will tell you if the registry considers it a valid response or not using for example &lt;PROP name="stylesheet" value="probably_valid"/&gt;  (don't use the das1: prefix) <a title="http://www.dasregistry.org/das/sources?capability=stylesheet" href="http://www.dasregistry.org/das/sources?capability=stylesheet">http://www.dasregistry.org/das/sources?capability=stylesheet</a>
</li><li>
sort by the following parameters: id, nickname or title, status (ie. uses leasedate), registerdate, leasedate, url, adminemail, description, capabilities (user/server specified), validcapabilities (sorts on valid capabilities determined by the registry not user/server selected), coordinatesystem (sorts by the number of coordinate systems a source specifies).
</li>
<li>
reverse=true parameter reverses the order of the above sorts.
<a title="http://www.dasregistry.org/das/sources?sort=title;reverse=true;rows=1-100" href="http://www.dasregistry.org/das/sources?sort=title;reverse=true;rows=1-100">http://www.dasregistry.org/das/sources?sort=title;reverse=true;rows=1-100</a>
</li>
</ul>
<h2>coordinatesystem commands</h2> (get coordinate systems that have been registered with the registry):
<ul>
<li>
Get all coordinate systems known to the DAS registry <a title="http://www.dasregistry.org/das/coordinatesystem" href="http://www.dasregistry.org/das/coordinatesystem">http://www.dasregistry.org/das/coordinatesystem</a>
</li>
<li>
Capability of getting single coordinate system from coordinatesystem url e.g. <a title="http://www.dasregistry.org/das/coordinatesystem/CS_DS7" href="http://www.dasregistry.org/das/coordinatesystem/CS_DS7">http://www.dasregistry.org/das/coordinatesystem/CS_DS7</a>
</li>
<li>
keywords parameter to coordinatesystem command <a title="http://www.dasregistry.org/das/coordinatesystem?keywords=gorilla" href="http://www.dasregistry.org/das/coordinatesystem?keywords=gorilla">http://www.dasregistry.org/das/coordinatesystem?keywords=gorilla</a>
</li>
<li>
Specify the rows to be returned <a title="http://www.dasregistry.org/das/coordinatesystem?keywords=gene&amp;rows=1-10" href="http://www.dasregistry.org/das/coordinatesystem?keywords=gene&amp;rows=1-10">http://www.dasregistry.org/das/coordinatesystem?keywords=gene&amp;rows=1-10</a>
</li>
</ul>
<h2>knownCapablities</h2> (responds with the DAS capabilities that the registry is aware of and supports):
<ul><li>
<a title="http://www.dasregistry.org/das/knownCapabilities" href="http://www.dasregistry.org/das/knownCapabilities">http://www.dasregistry.org/das/knownCapabilities</a>
</li>
</ul>
<h2>lastModified command</h2>(tells a client when the data on DAS sources was last updated and thus whether a client needs to make a new call to the registry):
<ul><li><a title="http://www.dasregistry.org/das/lastModified" href="http://www.dasregistry.org/das/lastModified">http://www.dasregistry.org/das/lastModified</a>
</li>
</ul>
<h2>validate command</h2> can be used to validate a server using the das registry and get back an xml sources response containing extra properties pertaining to the validity of specific capabilities:
<ul>
<li>
<a title="http://www.dasregistry.org/validate?url=http://das.sanger.ac.uk/das/otter_das/&amp;testcode=22:19173435,19372173" href="http://www.dasregistry.org/validate?url=http://das.sanger.ac.uk/das/otter_das/&amp;testcode=22:19173435,19372173">http://www.dasregistry.org/validate?url=http://das.sanger.ac.uk/das/otter_das/&amp;testcode=22:19173435,19372173</a>
</li>
</ul>
<h1>Server Commands (1.6 Specification)</h1>

<h2>Sources Command</h2>
<ul>
<li>
Request all sources from this server <a title="http://das.sanger.ac.uk/das/sources" href="http://das.sanger.ac.uk/das/sources">http://das.sanger.ac.uk/das/sources</a>
</li>
<li>
Request a source from this server with the id ens_zfish7_array (functionality as of 1.6 specification) <a title="http://das.sanger.ac.uk/das/ens_zfish7_array" href="http://das.sanger.ac.uk/das/ens_zfish7_array">http://das.sanger.ac.uk/das/ens_zfish7_array</a>
</li>
</ul>
<h2>entry_points command:</h2>
Get a list of the entry points for this reference DAS server (reference means it must return sequence for the entry points):
<ul><li>
<a title="http://das.sanger.ac.uk/das/test16genes/entry_points" href="http://das.sanger.ac.uk/das/test16genes/entry_points">http://das.sanger.ac.uk/das/test16genes/entry_points</a>
</li>
<li>
Due to the possibly large number of entry points for some servers as of 1.6 the rows parameter can be used to restrict this list to the first 10 rows (rows 1-10) currently as of writing I can't find many servers that support this:

<a title="http://das.sanger.ac.uk/das/test16genes/entry_points?rows=1-10" href="http://das.sanger.ac.uk/das/test16genes/entry_points?rows=1-10">http://das.sanger.ac.uk/das/test16genes/entry_points?rows=1-10</a>
</li>
<li>
<a title="http://das.sanger.ac.uk/das/test16genes/entry_points?rows=11-20" href="http://das.sanger.ac.uk/das/test16genes/entry_points?rows=11-20">http://das.sanger.ac.uk/das/test16genes/entry_points?rows=11-20</a>
</li>
</ul>
<h2>Sequence command:</h2>
<ul>
<li>
Get the sequence for segment P00280 <a title="http://www.ebi.ac.uk/das-srv/uniprot/das/uniprot/sequence?segment=P00280" href="http://www.ebi.ac.uk/das-srv/uniprot/das/uniprot/sequence?segment=P00280">http://www.ebi.ac.uk/das-srv/uniprot/das/uniprot/sequence?segment=P00280</a>
</li>
<li>
Get the sequence for chromosome 33 from start=3000001 to stop=3100000 <a title="http://www.ensembl.org/das/Canis_familiaris.BROADD2.reference/sequence?segment=33:3000001,3100000" href="http://www.ensembl.org/das/Canis_familiaris.BROADD2.reference/sequence?segment=33:3000001,3100000">http://www.ensembl.org/das/Canis_familiaris.BROADD2.reference/sequence?segment=33:3000001,3100000</a>
</li>
<li>
And the same for a genomic reference source: <a title="http://www.ensembl.org/das/Homo_sapiens.GRCh37.reference/sequence?segment=19:50595746,50595866" href="http://www.ensembl.org/das/Homo_sapiens.GRCh37.reference/sequence?segment=19:50595746,50595866">http://www.ensembl.org/das/Homo_sapiens.GRCh37.reference/sequence?segment=19:50595746,50595866</a>
</li>
<li>
Note that the UCSC uses different organism identifiers than the EBI/Sanger and also uses the old style dna command so to get sequence from the UCSC you would use:
<a title="http://genome.ucsc.edu/cgi-bin/das/hg19/dna?segment=19:50595746,50595866'" href="http://genome.ucsc.edu/cgi-bin/das/hg19/dna?segment=19:50595746,50595866'">http://genome.ucsc.edu/cgi-bin/das/hg19/dna?segment=19:50595746,50595866</a>
</li>
</ul>
<h2>Types Command:</h2>
<ul>
<li>
Show the feature types that this data source contains <a title="http://das.sanger.ac.uk/das/otter_das/types" href="http://das.sanger.ac.uk/das/otter_das/types">http://das.sanger.ac.uk/das/otter_das/types</a>
</li>
<li>
We should be able to filter these types based on a specific segment or range like http://das.sanger.ac.uk/das/otter_das/types?segment=1:1000000,2000000 but many servers do not seem to support this? As of 1.6 they should.
<a title="http://das.sanger.ac.uk/das/pjazz_berghei/types?segment=berg01:1000,15000" href="http://das.sanger.ac.uk/das/pjazz_berghei/types?segment=berg01:1000,15000">http://das.sanger.ac.uk/das/pjazz_berghei/types?segment=berg01:1000,15000</a> gives the number of types within the types element as 5 &lt;TYPE id="clone_genomic_insert" method="smalt"&gt;5&lt;/TYPE&gt;
</li>
<li>
<a title="http://das.sanger.ac.uk/das/pjazz_berghei/types" href="http://das.sanger.ac.uk/das/pjazz_berghei/types" target="_blank">http://das.sanger.ac.uk/das/pjazz_berghei/types</a> restults in a type element like this with 5109 features of this type as it's not restricted to a segment range &lt;TYPE id="clone_genomic_insert" method="smalt"&gt;5109&lt;/TYPE&gt;
</li>
</ul>
<h2>Features Command:</h2>

As this is probably the most commonly used command we will put the optional parameter string as stated by the specification:
<pre><em>SERVER</em>/das/<em>DSN</em>/features?segment=<em>RANGE</em>
                      [;segment=<em>RANGE</em>]
                      [;type=<em>TYPE</em>]
                      [;type=<em>TYPE</em>]
                      [;feature_id=<em>ID</em>]
                      [;maxbins=<em>BINS</em>]</pre>
and now for some examples:
<ul>
<li>
<a title="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;" href="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;">http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;</a>
</li>
<li>
<a title="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;type=contig" href="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;type=contig">http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;type=contig</a>
</li><li>
<a title="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;segment=21:30000000,30030000;type=supercontig" href="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;segment=21:30000000,30030000;type=supercontig">http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;segment=21:30000000,30030000;type=supercontig</a>
</li><li>
<a title="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;maxbins=1000" href="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;maxbins=1000">http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;maxbins=1000</a>
</li><li>
<a title="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;segment=21:30000000,30030000;type=supercontig;feature_id=HSCHR21_CTG1_1" href="http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;segment=21:30000000,30030000;type=supercontig;feature_id=HSCHR21_CTG1_1">http://www.derkholm.net:8080/das/hsa_59_37d/features?segment=22:29895696,29895696;segment=21:30000000,30030000;type=supercontig;feature_id=HSCHR21_CTG1_1</a>
</li></ul>
<h2>Stylesheet Command</h2>
<a title="http://www.derkholm.net:8080/das/hsa_59_37d/stylesheet" href="http://www.derkholm.net:8080/das/hsa_59_37d/stylesheet">http://www.derkholm.net:8080/das/hsa_59_37d/stylesheet</a>
<h2>structure:</h2>
<ul><li>
<a title="http://das.sanger.ac.uk/das/structure/structure?query=5pti" href="http://das.sanger.ac.uk/das/structure/structure?query=5pti">http://das.sanger.ac.uk/das/structure/structure?query=5pti</a>
</li></ul></div> 
</div>
<div id="secondarycontent">

<div class="contentarea">
Any suggestions please send them to <a href="mailto:dasregistry@sanger.ac.uk">dasregistry@sanger.ac.uk</a>
</div>
</div>
</div>

<%@ include file="sangerfooter.jsp"%>

